<div class="wrap">

{if $resp_message == null}
	<div id="ajaxResponse" class="ajaxResponse"></div>
{else}
	<div id="ajaxResponse" class="ajaxResponse fade" style="display:block">{$resp_message}</div>
{/if}
<h2>{TranslateTag}B_LABEL_CUSTOMER_MANAGEMENT{/TranslateTag}</h2>
	<table class="widefat">
		<thead>
			<p>
				<a href="?module={$smarty.get.module}&sub1=customer&act=newcustomer"><img src="../view/admin/images/object_create.png" alt="Create" /></a>
			</p>
		<tr>
			<th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1={$smarty.get.sub1}{/if}&sort=customer_id&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_ID{/TranslateTag}</th>
	        <th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1={$smarty.get.sub1}{/if}&sort=customer_firstname&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_CUSTOMER_NAME{/TranslateTag}</th>
	        <th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1={$smarty.get.sub1}{/if}&sort=customer_email&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_CUSTOMER_EMAIL{/TranslateTag}</th>
      		{if $smarty.session.user_isadmin == "1"}
      			<th colspan="2" style="text-align: center">{TranslateTag}B_LABEL_ACTION{/TranslateTag}</th>
      		{/if}
		</tr>
		</thead>
		<tbody id="thelist">
			{foreach name=customer from=$CUSTOMERS.data item=item}
				<tr id="customer-{$item->customer_id}" class="{cycle values=,alternate}">
					<th scope='row' style='text-align: left'>{$item->customer_id}</th>
					<td align='left'>{$item->customer_firstname}, {$item->customer_lastname}</td>
					<td align='left'>{$item->customer_email}</td>
					{if $smarty.session.user_isadmin == "1"}
					<td><a href="?module={$smarty.get.module}&sub1=customer&act=editcustomer&id={$item->customer_id}" class='edit'><img src="../view/admin/images/object_edit.png" alt="Edit" /></a></td>
					<td>
            <a onclick="onDeleteCustomer('?module={$smarty.get.module}&sub1=customer', '{$item->customer_id}', 'ajaxResponse')" class='delete'><img src="../view/admin/images/object_delete.png" alt="Delete" /></a>
          </td>
					{/if}
				</tr>
			{/foreach}
		</tbody>
	</table>
	{if $CUSTOMERS.data != NULL}
     <div>			
      <div style="width:300px; float:left"> 
          {TranslateTag}LABEL_PAGES{/TranslateTag} : {$CUSTOMERS.TOTAL} {TranslateTag}LABEL_OF{/TranslateTag} {$CUSTOMERS.TOTALDATA}
      </div>			
      <div style="text-align:right; float:right" >{$CUSTOMERS.FIRST} {$CUSTOMERS.PRE}&nbsp;{$CUSTOMERS.LISTPAGE} {TranslateTag}LABEL_OF{/TranslateTag} &nbsp; {$CUSTOMERS.TOTALPAGE} &nbsp;                   
          <select onchange="javascript:window.location='{$CUSTOMERS.LINK}&{$CUSTOMERS.PATHNAME}='+this.value">
            {$CUSTOMERS.COMBOPAGE}                     
          </select>&nbsp;{$CUSTOMERS.NEXT} {$CUSTOMERS.LAST}         
      </div>
      <div style="clear:both"></div>		
    </div>	     
    {/if}
    <p>
		<a href="?module={$smarty.get.module}&sub1=customer&act=newcustomer"><img src="../view/admin/images/object_create.png" alt="Create" /></a>
	</p>
</div>
